<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>arm_nntables.c File Reference</title>
<title>CMSIS-NN: arm_nntables.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 46px;">
  <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">CMSIS-NN
   &#160;<span id="projectnumber">Version 1.2.0</span>
   </div>
   <div id="projectbrief">CMSIS NN Software Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
    <ul class="tablist">
      <script type="text/javascript">
		<!--
		writeComponentTabs.call(this);
		//-->
      </script>
	  </ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
      <li><a href="modules.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('arm__nntables_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">arm_nntables.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ae2ff3f4e7014f535358167150bdd544f"><td class="memItemLeft" align="right" valign="top">const q7_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arm__nntables_8c.html#ae2ff3f4e7014f535358167150bdd544f">sigmoidTable_q7</a> [256]</td></tr>
<tr class="memdesc:ae2ff3f4e7014f535358167150bdd544f"><td class="mdescLeft">&#160;</td><td class="mdescRight">tables for various activation functions  <a href="#ae2ff3f4e7014f535358167150bdd544f">More...</a><br/></td></tr>
<tr class="separator:ae2ff3f4e7014f535358167150bdd544f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4d7b07c387a3537d4efe21da86115b0"><td class="memItemLeft" align="right" valign="top">const q15_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arm__nntables_8c.html#ab4d7b07c387a3537d4efe21da86115b0">sigmoidTable_q15</a> [256]</td></tr>
<tr class="memdesc:ab4d7b07c387a3537d4efe21da86115b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">tables for various activation functions  <a href="#ab4d7b07c387a3537d4efe21da86115b0">More...</a><br/></td></tr>
<tr class="separator:ab4d7b07c387a3537d4efe21da86115b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69dc528cb377690d5b37accfdfd226b1"><td class="memItemLeft" align="right" valign="top">const q15_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arm__nntables_8c.html#a69dc528cb377690d5b37accfdfd226b1">sigmoidLTable_q15</a> [128]</td></tr>
<tr class="separator:a69dc528cb377690d5b37accfdfd226b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a107a16eaa36f4392fa3ed3792ad6c2cb"><td class="memItemLeft" align="right" valign="top">const q15_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arm__nntables_8c.html#a107a16eaa36f4392fa3ed3792ad6c2cb">sigmoidHTable_q15</a> [192]</td></tr>
<tr class="memdesc:a107a16eaa36f4392fa3ed3792ad6c2cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">2-way tables for various activation functions  <a href="#a107a16eaa36f4392fa3ed3792ad6c2cb">More...</a><br/></td></tr>
<tr class="separator:a107a16eaa36f4392fa3ed3792ad6c2cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f854bdf13f630ec21b3ad074491e32f"><td class="memItemLeft" align="right" valign="top">const q7_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arm__nntables_8c.html#a4f854bdf13f630ec21b3ad074491e32f">tanhTable_q7</a> [256]</td></tr>
<tr class="separator:a4f854bdf13f630ec21b3ad074491e32f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6faad2fec173b2702fd0f219a83ca320"><td class="memItemLeft" align="right" valign="top">const q15_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arm__nntables_8c.html#a6faad2fec173b2702fd0f219a83ca320">tanhTable_q15</a> [256]</td></tr>
<tr class="separator:a6faad2fec173b2702fd0f219a83ca320"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7cb5ad2fff7e241d09024332488a706e"><td class="memItemLeft" align="right" valign="top">const q15_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arm__nntables_8c.html#a7cb5ad2fff7e241d09024332488a706e">tanhLTable_q15</a> [128]</td></tr>
<tr class="separator:a7cb5ad2fff7e241d09024332488a706e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d093f7b0dc798d4898ff4fd125b21a6"><td class="memItemLeft" align="right" valign="top">const q15_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="arm__nntables_8c.html#a4d093f7b0dc798d4898ff4fd125b21a6">tanhHTable_q15</a> [192]</td></tr>
<tr class="separator:a4d093f7b0dc798d4898ff4fd125b21a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="a107a16eaa36f4392fa3ed3792ad6c2cb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const q15_t sigmoidHTable_q15[192]</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>2-way table, H table for value larger than 1/4 L table for value smaller than 1/4, H table for remaining We have this only for the q15_t version. It does not make sense to have it for q7_t type </p>

</div>
</div>
<a class="anchor" id="a69dc528cb377690d5b37accfdfd226b1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const q15_t sigmoidLTable_q15[128]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ab4d7b07c387a3537d4efe21da86115b0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const q15_t sigmoidTable_q15[256]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Referenced by <a class="el" href="group__Acti.html#ga8932b57c8d0ee757511af2d40dcc11e7">arm_nn_activations_direct_q15()</a>.</p>

</div>
</div>
<a class="anchor" id="ae2ff3f4e7014f535358167150bdd544f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const q7_t sigmoidTable_q7[256]</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This file include the declaration of common tables. Most of them are used for activation functions</p>
<p>Assumption: Unified table: input is 3.x format, i.e, range of [-8, 8) sigmoid(8) = 0.9996646498695336 tanh(8) = 0.9999997749296758 The accuracy here should be good enough</p>
<p>2-stage HL table:</p>
<p>The entire input range is divided into two parts:</p>
<p>Low range table: 0x000x xxxx or 0x111x xxxx table entry will be the binary number excluding the first two digits, i.e., 0x0x xxxx or 0x1x xxxx</p>
<p>High range table 0x0010 0000 &ndash; 0x0111 1111 0x1000 0000 &ndash; 0x1101 1111</p>
<p>For positive numbers, table entry will be 0x0010 0000 &ndash; 0x0111 1111 minus 0x0010 0000 i.e., 0x0000 0000 - 0x0101 11111</p>
<p>same thing for the negative numbers, table entry will be 0x1000 0000 &ndash; 0x1101 1111 minux 0x0010 0000 i.e., 0x0110 0000 - 0x1011 1111 </p>

<p>Referenced by <a class="el" href="group__Acti.html#ga79f11131ae6767d60e03b1f6506b1af8">arm_nn_activations_direct_q7()</a>.</p>

</div>
</div>
<a class="anchor" id="a4d093f7b0dc798d4898ff4fd125b21a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const q15_t tanhHTable_q15[192]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a7cb5ad2fff7e241d09024332488a706e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const q15_t tanhLTable_q15[128]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a6faad2fec173b2702fd0f219a83ca320"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const q15_t tanhTable_q15[256]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Referenced by <a class="el" href="group__Acti.html#ga8932b57c8d0ee757511af2d40dcc11e7">arm_nn_activations_direct_q15()</a>.</p>

</div>
</div>
<a class="anchor" id="a4f854bdf13f630ec21b3ad074491e32f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const q7_t tanhTable_q7[256]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Referenced by <a class="el" href="group__Acti.html#ga79f11131ae6767d60e03b1f6506b1af8">arm_nn_activations_direct_q7()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_06560e3359c5da94845158f0031c08e8.html">NN</a></li><li class="navelem"><a class="el" href="dir_13dc9928808d08450b31fdaf572dfc8e.html">Source</a></li><li class="navelem"><a class="el" href="dir_4ad8c19a899a351ef23a1c3a29886c7d.html">NNSupportFunctions</a></li><li class="navelem"><a class="el" href="arm__nntables_8c.html">arm_nntables.c</a></li>
    <li class="footer">Generated on Wed Jul 10 2019 15:20:50 for CMSIS-NN Version 1.2.0 by Arm Ltd. All rights reserved.
	<!--
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
	-->
	</li>
  </ul>
</div>
</body>
</html>
